/**
 * 聊天相关类型定义
 */

// 聊天消息类型
export interface ChatMessage {
  id: string;
  role: "user" | "assistant" | "system";
  content: string;
  createdAt: Date;
}

// 聊天类型
export interface Chat {
  id: string;
  title: string;
  messages: ChatMessage[];
  knowledgeBaseId: string;
  createdAt: Date;
  updatedAt: Date;
}

// 知识库类型
export interface KnowledgeBase {
  id: string;
  name: string;
  description: string;
  documents: Document[];
  createdAt: Date;
  updatedAt: Date;
}

// 文档类型
export interface Document {
  id: string;
  name: string;
  content: string;
  fileType: string;
  fileSize: number;
  knowledgeBaseId: string;
  createdAt: Date;
}

// 模型设置类型
export interface ModelSettings {
  // 对话模型配置
  chatModel: {
    type: "openai" | "llama" | "custom";
    apiUrl: string;
    apiKey: string;
    model: string;
    temperature: number;
    topP: number;
    maxTokens: number;
  };
  
  // 嵌入模型配置
  embeddingModel: {
    type: "openai" | "custom";
    apiUrl: string;
    apiKey: string;
    model: string;
  };
}

// 向量搜索结果
export interface SearchResult {
  content: string;
  similarity: number;
  documentId: string;
  documentName?: string;
} 